package org.zhou.demo1;

import org.zhou.demo1.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Client1 {
    public static void main(String[] args) {

        List<LogModel> logModels = new ArrayList<>(Arrays.asList(
                new LogModel("003", "zhouweixin", "2020-08-02 17:46:20", "这是文件的第三个测试日志"),
                new LogModel("004", "zhouweixin", "2020-08-02 17:50:20", "这是文件的第四个测试日志")));

        LogFileOperateApi logFileOperateApi = new LogFileOperateImpl(null);
        LogDbOperateApi logDbOperate = new Adapter(logFileOperateApi);

        // 写日志
        logModels.forEach(logDbOperate::createLog);

        // 读日志
        List<LogModel> logs = logDbOperate.getAllLog();
        System.out.println(logs);
    }
}
